package com.sitech.openapi.controller.Order;

import com.sitech.openapi.controller.AbstractController;
import com.sitech.openapi.domain.Order.CollectionOrderNotification;
import com.sitech.openapi.service.YiDiXiaoHuService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

@Api(tags = "工单处理通知控制层",description = "工单处理通知")
@RestController
@Slf4j
public class YiDiXiaoHuController extends AbstractController {

    @Autowired
    YiDiXiaoHuService yiDiXiaoHuService;

    @PostMapping("/collectionOrderNotification")
    @ApiOperation(value = "工单处理通知",notes = "工单处理通知")
    public ResponseEntity<String> queryTestByPara(@RequestBody CollectionOrderNotification collectionOrderNotification,
                                                                       @RequestHeader HttpHeaders headers){
        log.info("入参消息头信息》》》》》》》》》》》》》》》" + headers.toString());
        log.info("入参----------------------------" + collectionOrderNotification.toString());


        String aa = yiDiXiaoHuService.dealCollectOrder(collectionOrderNotification);
        ResponseEntity<String> res = new ResponseEntity<String>(aa, initOKHeader(headers), HttpStatus.OK);
        return res;
    }
}
